(DEFUN c:flipseal ( / this_layer_list)
  (SETQ this_layer_list (TBLNEXT "LAYER" "T"))
  (WHILE (AND
	   (NOT (WCMATCH (STRCASE (CDR (ASSOC 2 this_layer_list))) "*PRELIM*"))
	   (SETQ this_layer_list (TBLNEXT "LAYER"))
	 )
  )
  (IF (AND
        this_layer_list
	(WCMATCH (STRCASE (CDR (ASSOC 2 this_layer_list))) "*PRELIM*")
      )
    (PROGN
      (IF (EQ 1 (BOOLE 1 1 (CDR (ASSOC 70 this_layer_list)))); is 1 included in the values for Assoc 70 (Is the layer frozen)?
 ; if PRELIM NOTE is frozen
        (PROGN (COMMAND ".-LAYER" "T" "*PRELIM NOTE*" ""); you can use wildcards here
               (COMMAND ".-LAYER" "F" "*SEAL*" "")       ; you can use wildcards here
        ) ;_ end of PROGN
 ; else if PRELIM NOTE is thawed
        (PROGN (COMMAND ".-LAYER" "F" "*PRELIM NOTE*" ""); you can use wildcards here
               (COMMAND ".-LAYER" "T" "*SEAL*" "")       ; you can use wildcards here
        ) ;_ end of PROGN
      ) ;_ end of IF
    )
    (PRINC "\nNo layer name matching \"*PRELIM*\" was found! ")
  )
  (PRINC)
)